package RedisTest;

import redis.clients.jedis.Jedis;

public class RedisConnect {
    public static void main(String[] args) {
        Jedis jedis = new Jedis("127.0.0.1", 6379);
        System.out.println(jedis.ping());
        System.out.println(jedis.mget("dog","cat","bigdog"));
        jedis.flushDB();
        System.out.println(jedis.mget("dog","cat","bigdog"));
        System.out.println("*************");
        jedis.set("dog","狗");
        jedis.set("cat","猫");
        jedis.set("bigdog","大狗");
        System.out.println(">>>>>>>>>>>>>>>>>>>");
        System.out.println(jedis.get("dog"));
        System.out.println("<<<<<<<<<<<<<<<<<<<<<");
        System.out.println(jedis.get("狗"));
        jedis.set("dog","狗崽子");
        System.out.println(jedis.get("dog"));
        jedis.close();
    }
}
